// Copyright (c) 2020 Presto Labs Pte. Ltd.
// Author: jshin

#pragma once

#include "coin/proto/coin_market_enums.pb.h"
#include "coin2/exchange/base/feed/subscriber.h"
#include "coin2/exchange/base/feed/update.h"

class TimingStrategy : public IFeedSubscriber {
 public:
  void onTradeFeed(const FeedUpdate& upd) {
    auto now2 = std::chrono::high_resolution_clock::now();
    int64_t now = now2.time_since_epoch().count();
    std::cout << now << " " << upd.timestamp() << " " << now - upd.timestamp() << std::endl;
  }

  void onBookFeed(const FeedUpdate& upd) {
    auto now2 = std::chrono::high_resolution_clock::now();
    int64_t now = now2.time_since_epoch().count();
    std::cout << now << " " << upd.timestamp() << " " << now - upd.timestamp() << std::endl;
  }
};

